﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace WCFMastering.Framework
{
    public class InstanceContext<T>
    {
        #region Ctors

        public InstanceContext(T callbackInstance)
        {
            Context = new InstanceContext(callbackInstance);
        }

        #endregion

        #region Properties

        public InstanceContext Context
        {
            get;
            protected set;
        }

        public T ServiceInstance
        {
            get 
            {
                return (T)Context.GetServiceInstance();
            }
        }

        #endregion

        public void ReleaseServiceInstance()
        {
            Context.ReleaseServiceInstance();
        }
    }
}
